package com.javatraining.corejava.homework.television;
/**
 * @author kmatharasi
 * 
 * Class to define atleast 5 states , 5 methods for creating a  Television object .
 *
 */

public class Television {
	
	// below are the different states that are useful to define a Television .
	
	 private String make;
		
	 private String serialNumber;
	
	 private int year;
	
	 private int numberOfChannels=4;
	
	 private int channelNumber;
	
	 private int subscription;
	
	 private String port;

	 private boolean switChedOn=false;
	
	 private String model;
	 
	 
	 public String getModel() {
		return model;
	}



	public void setModel(String model) {
		this.model = model;
	}



	public String getMake() {
		return make;
	}



	public void setMake(String make) {
		this.make = make;
	}



	public String getSerialNumber() {
		return serialNumber;
	}



	public void setSerialNumber(String serialNumber) {
		this.serialNumber = serialNumber;
	}



	public int getYear() {
		return year;
	}



	public void setYear(int year) {
		this.year = year;
	}



	public int getNumberOfChannels() {
		return numberOfChannels;
	}



	public void setNumberOfChannels(int numberOfChannels) {
		this.numberOfChannels = numberOfChannels;
	}



	public int getChannelNumber() {
		return channelNumber;
	}



	public void setChannelNumber(int channelNumber) {
		this.channelNumber = channelNumber;
	}



	public int getSubscription() {
		return subscription;
	}



	public void setSubscription(int subscription) {
		this.subscription = subscription;
	}



	public String getPort() {
		return port;
	}



	public void setPort(String port) {
		this.port = port;
	}



	public boolean isSwitChedOn() {
		return switChedOn;
	}



	public void setSwitChedOn(boolean switChedOn) {
		this.switChedOn = switChedOn;
	}



	 
	// below are the 5 different behaviors that a Television  exhibits .
	
	
			 public void On(boolean switChedOn)
			
			 
			 {
				 this.switChedOn=switChedOn;
				 
				 if(switChedOn=true)
				 {
					 System.out.println("Television is switched on");
					 System.out.println("----------------------");
				 }		 		 
				 
			 }
			 	
			
			
			 public void selectChannel( int channelNumber)
				
			 {
				 this.channelNumber = channelNumber;
				 
				 switch (channelNumber)
				 {
				 case 1: System.out.println("Channel selected is Fox");
				 System.out.println("---------------------------------");
				 break;
				 
				 case 2: System.out.println("Channel selected is CNN");
				 System.out.println("------------------------------");
				 break;
				 
				 case 3: System.out.println("Channel selected is KPLR11");
				 System.out.println("--------------");
				 break;
		         
				 case 4: System.out.println("Channel selected is ESPN");
				 System.out.println("-------------------------------------");
				 break;
				 
				 default:
				 {
					 System.out.println("Invalid channel selected");
					 System.out.println("----------------------------");
				 }
				 
				 }
				 		 
			 }
			 
			 
			 public void upgrade(int subscription)
			 
			 {  this.subscription = subscription;
			 
				 if( subscription>0 && subscription<=40)
				 {
					 System.out.println("You are subscribed to basic channels");
					 System.out.println("--------------------------------------");
				 }
				 
				 else if( subscription>40 || subscription<=70)
				 {
					 
					 System.out.println("You are subscribed to premium channels");
					 System.out.println("--------------------------------------------");
					 
				 }	 
				 
				 else if( subscription>70)
				 {
					 
					 System.out.println("You are subscribed to premium channels in HD");
					 System.out.println("--------------------------------------------------");
					 
				 }	
				 
				 else
				 {
					 System.out.println("Invalid Subscription");
					 System.out.println("----------------------------------------");
				 }
			 }
			 
			 
			
			 
			 public void connectPort(String port)
			 {
				 this.port = port;
				
			 
				 if(port=="usb")
				 {
					 System.out.println("USB port is ready to connect");
					 System.out.println("----------------------------");
				 }
				 else if(port=="hdmi")
				 {
					 System.out.println("HDMI port is ready to coonect");
					 System.out.println("--------------------");
				 }
				 
				 else if(port=="wifi")
				 {
					 System.out.println("HDMI port is ready to coonect");
					 System.out.println("--------------------");
				 }
				 
				 else{
					 System.out.println("Invalid Port");
				 }
				 
			 }
			 
				
			 public void Off(boolean switChedOn)
				
			 {
				 
				 this.switChedOn = switChedOn;
				
				 
					 System.out.println("Television is  switched off");
					 System.out.println("-------------------------");
				 
			 

			 }	
	
}
